# 使用replace()

print("The first time:")
with open('pi_digits.txt') as file_object:
    content = file_object.read()
    
print(content.replace('5', '五').rstrip())

print("\nThe second time:")
with open('pi_digits.txt') as file_object:
    for line in file_object:
        print(line.replace('5', '五').rstrip())

print("\nThe third time:")
with open('pi_digits.txt') as file_object:
    lines = file_object.readlines()

for line in lines:
    print(line.replace('5', '五').rstrip())
